package com.wangzhixuan;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;

@EnableCaching
@SpringBootApplication(exclude = RedisAutoConfiguration.class)
public class Bootstarp extends SpringBootServletInitializer {
    /**
     * 配置tomcat容器支持
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //解决 elasticsearch 和 redis 冲突
        System.setProperty("es.set.netty.runtime.available.processors", "false");
        return builder.bannerMode(Banner.Mode.OFF).sources(getClass());
    }

    public static void main(String[] args) {
        SpringApplication.run(Bootstarp.class, args);
    }

}
